var invertTree = function(root) {
    if(!root)return root
    let temp=root.right
    root.right=invertTree(root.left)
    root.left=invertTree(temp)
    return root
    };